inspector: Show names for css nodes
authorMatthias Clasen <mclasen@redhat.com>
Fri, 23 Oct 2015 00:58:08 +0000 (20:58 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 23 Oct 2015 00:58:08 +0000 (20:58 -0400)
Currently, we don't have any css nodes with names, but we will soon.

gtk/inspector/css-node-tree.c
gtk/inspector/css-node-tree.ui

index 03a9a99fb1cc2785bebb5022111f243386dfa296..48b5b75d50c8f8116b2b1f4543b15b85f0229fd1 100644 (file)
@@ -31,6 +31,7 @@
 
 enum {
   COLUMN_NAME,
+  COLUMN_TYPE,
   COLUMN_VISIBLE,
   COLUMN_CLASSES,
   COLUMN_ID,
@@ -99,6 +100,10 @@ gtk_inspector_css_node_tree_get_node_value (GtkTreeModelCssNode *model,
   switch (column)
     {
     case COLUMN_NAME:
+      g_value_set_string (value, gtk_css_node_get_name (node));
+      break;
+
+    case COLUMN_TYPE:
       g_value_set_string (value, g_type_name (gtk_css_node_get_widget_type (node)));
       break;
 
@@ -136,6 +141,7 @@ gtk_inspector_css_node_tree_init (GtkInspectorCssNodeTree *cnt)
   priv->model = gtk_tree_model_css_node_new (gtk_inspector_css_node_tree_get_node_value,
                                              N_COLUMNS,
                                              G_TYPE_STRING,
+                                             G_TYPE_STRING,
                                              G_TYPE_BOOLEAN,
                                              G_TYPE_STRING,
                                              G_TYPE_STRING);
index f2cbab0d916a7c93ba3e26c47beede5734613492..d9903ace548ff093e660aaa5c3234dbd1d35f873 100644 (file)
           <object class="GtkTreeView" id="tree_view">
             <property name="visible">True</property>
             <child>
-              <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+              <object class="GtkTreeViewColumn">
+                <property name="resizable">True</property>
+                <property name="title" translatable="yes">Type</property>
+                <child>
+                  <object class="GtkCellRendererText"/>
+                  <attributes>
+                    <attribute name="text">1</attribute>
+                    <attribute name="sensitive">2</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn">
                 <property name="resizable">True</property>
                 <property name="title" translatable="yes">Name</property>
                 <child>
                   <object class="GtkCellRendererText"/>
                   <attributes>
                     <attribute name="text">0</attribute>
-                    <attribute name="sensitive">1</attribute>
+                    <attribute name="sensitive">2</attribute>
                   </attributes>
                 </child>
               </object>
             </child>
             <child>
-              <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+              <object class="GtkTreeViewColumn">
                 <property name="resizable">True</property>
                 <property name="title" translatable="yes">ID</property>
                 <child>
                   <object class="GtkCellRendererText"/>
                   <attributes>
-                    <attribute name="text">3</attribute>
-                    <attribute name="sensitive">1</attribute>
+                    <attribute name="text">4</attribute>
+                    <attribute name="sensitive">2</attribute>
                   </attributes>
                 </child>
               </object>
             </child>
             <child>
-              <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+              <object class="GtkTreeViewColumn">
                 <property name="resizable">True</property>
                 <property name="title" translatable="yes">Classes</property>
                 <child>
                   <object class="GtkCellRendererText"/>
                   <attributes>
-                    <attribute name="text">2</attribute>
-                    <attribute name="sensitive">1</attribute>
+                    <attribute name="text">3</attribute>
+                    <attribute name="sensitive">2</attribute>
                   </attributes>
                 </child>
               </object>